mainApp.service('oldGoodsService', ['$resource',function ($resource){
    
    //旧物交易展示列表信息
    this.getoldGoogsList = function(pageIndex,pageSize,param,success,error){
        return $resource(baseUrl+"/mapi/moldsRetrieve/list/:pageIndex/:pageSize",{pageIndex:pageIndex,pageSize:pageSize}).save(param,success,error);
    };
    
    //商品详情信息
    this.getOldGoodsDetails = function(goodsId, success, error){
    	return $resource(baseUrl + "/mapi/mGoods/get/"+goodsId).get( success, error);
    };
    //获取类型
    this.getGoodType =function(goodKind,success,error){
    	return $resource(baseUrl+"/mapi/moldsRetrieve/getGoodType/"+goodKind).get(success, error);
    }
    //旧物提交
   	 this.addOld = function(param,success,error){
        return $resource(baseUrl+"/mapi/moldsRetrieve/add").save(param,success,error);
    };
    //根据id查询旧物
    this.getOldByID = function(oldID, success, error){
    	return $resource(baseUrl + "/mapi/moldsRetrieve/getOldByID/"+oldID).get( success, error);
    };
    //字典查询
     this.getDicList =function(dicType,success,error){
    	return $resource(baseUrl+"/mapi/mdic/getDicCacheByType/"+dicType).get(success, error);
    }
      //旧物提交--修改
   	 this.updateOld = function(old,success,error){
        return $resource(baseUrl+"/mapi/moldsRetrieve/update").save(old,success,error);
    };
}]);

